package com.haulmont.asu.web.ui.diploma_project;

import com.haulmont.cuba.gui.WindowManager;
import com.haulmont.cuba.gui.components.AbstractLookup;
import com.haulmont.cuba.gui.components.Table;
import com.haulmont.cuba.gui.components.actions.CreateAction;
import com.haulmont.cuba.gui.components.actions.EditAction;

import javax.inject.Inject;
import java.util.Map;

/**
 * Author: Sergey42
 * Date: 09.11.13 6:53
 */
public class DiplomaBrowser extends AbstractLookup {

    @Inject
    protected Table diplomaTable;

    @Override
    public void init(Map<String, Object> params) {
        super.init(params);

        diplomaTable.removeAction(getAction("diplomaTable.create"));
        diplomaTable.addAction(new CreateAction(diplomaTable, WindowManager.OpenType.DIALOG));

        diplomaTable.removeAction(getAction("diplomaTable.edit"));
        diplomaTable.addAction(new EditAction(diplomaTable, WindowManager.OpenType.DIALOG));
    }

}
